package com.panshi.api;

import com.panshi.vo.qa.DataResultQA;
import com.panshi.vo.qa.Pages;
import com.panshi.vo.qa.Reply;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "qa-server",contextId = "reply-api")
public interface IReplyApi {
    /*IReplyApi(回答Api)*/

    /**
     * 分页查询
     * @param pages
     * @return
     */
    @PostMapping("/reply/inquirePages")
    @ResponseBody
    DataResultQA<Pages<Reply>> inquirePagesReply(@RequestBody Pages pages);

    /**
     * 查询总记录数
     * @param pages
     * @return
     */
    @GetMapping("/reply/inquireSum")
    @ResponseBody
    DataResultQA<Integer> inquireReplySum(@RequestParam Pages pages);

    /**
     * 通过id查询回答
     * @param id
     * @return
     */
    @PostMapping("/reply/inquireById/{id}")
    @ResponseBody
    DataResultQA<Reply> inquireByIdReply(@PathVariable int id);

    /**
     * 点赞总数加一
     * @param id
     * @return
     */
    @GetMapping("/reply/praiseSumAnd1/{id}")
    @ResponseBody
    DataResultQA praiseSumAnd1_Reply(@PathVariable int id);

    /**
     * 点赞总数减一
     * @param id
     * @return
     */
    @GetMapping(value = "/reply/praiseSumSubtract1/{id}")
    @ResponseBody
    DataResultQA praiseSumSubtract1_Reply(@PathVariable int id);

    /**
     * 点踩总数加一
     * @param id
     * @return
     */
    @GetMapping("/reply/trampleSumAnd1/{id}")
    @ResponseBody
    DataResultQA trampleSumAnd1_Reply(@PathVariable int id);

    /**
     * 点踩总数减一
     * @param id
     * @return
     */
    @GetMapping(value = "/reply/trampleSumSubtract1/{id}")
    @ResponseBody
    DataResultQA trampleSumSubtract1_Reply(@PathVariable int id);

    /**
     * 删除(标记删除)
     * @param id
     * @return
     */
    @GetMapping("/reply/delete/{id}")
    @ResponseBody
    DataResultQA deleteReply(@PathVariable int id);
}
